package com.k2data.k2app.domain.po;

//: object
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.k2data.k2app.constant.Constant;
import com.k2data.k2app.domain.vo.Job;
import com.k2data.k2app.domain.vo.Model;
import com.k2data.k2app.mybatis.handler.JsonTypeHandler;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import scala.Int;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.time.LocalDateTime;
import java.util.Map;

/**
 * 任务和作业关联表
 */
@Data
@Table(name = "early_waring")
public class EarlyWaringDO {

    private Long id;
    /**
     * 设备编号
     */
    private String deviceNo;

    /**
     * 设备名称
     */
    private String deviceName;

    /**
     * 告警消息
     */
    private String message;

    /**
     * 告警时间
     */
    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime waringTime;

    /**
     * 告警类型，实时告警还是故障告警
     */
    private String type;

    /**
     * 告警信息关联的作业id
     */
    private Long jobId;

    /**
     * 告警等级，健康状况
     */
    private String level;

    /**
     * 处理类型 value
     */
    private Integer dealType;
    /**
     * 是否站内
     */
    private Integer isMq;
    /**
     * 是否短信
     */
    private Integer isSms;
    /**
     * 是否要发送邮件
     */
    private Integer isMail;
    private Long modelId;
    /**
     * 处理类型名称
     */
    private String dealTypeName;

    private String dealUser;

    private Long owner;

    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime dealTime;

    @JsonIgnore
    private Integer isDelete ;

    @JsonIgnore
    private Integer pageNum ;
    @JsonIgnore
    private Integer pageSize ;

    @Transient
    private Integer count ;
    /**
     * 模型
     */
    @Transient
    private Model model;

    /**
     * 模型
     */
    @Transient
    private Job job;


    /**
     * 查询开始时间
     */
    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime startTime;
    /**
     * 查询终止时间
     */
    @JsonFormat(pattern = Constant.ISO_FORMAT)
    @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
    private LocalDateTime endTime;

    private String faultName;

    @Transient
    private Map device;
	/**
	 * 颜色
	 */
	@Transient
	@ColumnType(typeHandler = JsonTypeHandler.class)
	private Map<String, String> ext;
}
///:~